package com.haolijun.eecms.controller.form;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @ClassName SearchFacilityByPageForm
 * @Description TODO
 * @Author hljstart
 * @Date 2023/3/12 14:52
 * @Version 1.0
 */
@Data
public class SearchFacilityByPageForm {
    @NotNull(message = "page不能为空")
    @Min(value = 1,message = "page小于1")
    @Schema(description = "页数")
    private Integer page;

    @NotNull(message = "length")
    @Range(min = 5, max = 50, message = "length必须在10~50之间")
    @Schema(description = "每页记录数")
    private Integer length;

//    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,10}$", message = "name内容不正确")
    @Schema(description = "设备名称")
    private String name;

    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{1,3}$",message = "设备类型格式错误")
    @Schema(description = "设备类型")
    private String type;
}
